﻿using System;
using System.Collections.Generic;
using System.Text;
using PluginInterface;

namespace xmltv
{
    public class EpgPlugin : IEpgPlugin
    {
        private string name = "xmltv";
        private string comment = "Works with versions 0.35.1 and higher";
        private string author = "MulticastTV";
        private string version = "1.0";
        private string multicasttvVersion = "0.35.1.0";
        private string lockedToLang = "";
        private string type = "offline";

        // default regex settings
        private string hostname = "file://localhost:38888";
        private string httpMethod = "GET";
        private string initRequest = "";
        private string initHttpMethod = "";
        private bool initRequestNeeded = false;  

        IPluginHost myHost = null;

        public IPluginHost Host
        {
            get { return myHost; }
            set { myHost = value; }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public EpgPlugin()
        {

        }

        public string Author
        {
            get { return author; }
        }

        public string Version
        {
            get { return version; }
        }

        public string MulticasttvVersion
        {
            get { return multicasttvVersion; }
        }

        public string Comment
        {
            get { return comment; }
        }

        public string Name
        {
            get { return name; }
        }

        public string PluginType
        {
            get { return type; }
        }

        public string LockedToUserInterfaceLangue
        {
            get { return lockedToLang; }
        }

        public string HostName
        {
            get { return hostname; }
        }

        public string RequestMethod
        {
            get { return httpMethod; }
        }

        public string InitialRequest
        {
            get { return initRequest; }
        }

        public bool InitialRequestNeeded
        {
            get { return initRequestNeeded; }
            set { initRequestNeeded = value; }
        }

        public string InitialRequestMethod
        {
            get { return initHttpMethod; }
        }


        public void Initialize(string Path)
        {

        }

        public void Dispose()
        {

        }

        public string[] GetTodayRequest(string ChannelId)
        {
            string request = "";
            string referer = "";
            string postString = "";

            string[] RequestParams = {request,    // http request
                                      referer ,    // http referer
                                      postString  // POST string
                                     };
            return RequestParams;
        }

        public string[] GetTodaySunmmaryRequest()
        {
            string[] RequestParams = { };
            return RequestParams;

        }

        public void ParseInitPage(string Html)
        {

        }

        public List<string[]> ParseToday(string Html)
        {
            List<string[]> Plist = new List<string[]>();
            Plist.Clear();
            return Plist;
        }

        public string[] ParseDetails(string Html)
        {
            //string title, string genre, string description, string channelName, string time, string custom1Desc, string custom1, string custom2Desc, string custom2, picture link
            return new string[] { "", "", "", "", "", "", "", "", "", "" };
        }
        public List<string[]> ParseTodaySummary(string Html)
        {
            List<string[]> Plist = new List<string[]>();
            Plist.Clear();
            return Plist;
        }
    }
}
